import request from '@/config/axios'

/**
 * 教学楼相关接口
 */
export function useBuildingApi() {
    return {
        // 分页
        getPage: async (params: PageParam) => {
            return await request.get({url: '/yxt/building/page', params})
        },
        // 删除
        deleteObj: async (id: number) => {
            return await request.delete({url: '/yxt/building/delete?id=' + id})
        },
        // 查询
        getObj: async (id: number) => {
            return await request.get({url: '/yxt/building/get?id=' + id})
        },
        // 创建
        createObj: (data: any) => {
            return request.post({url: '/yxt/building/create', data})
        },
        // 更新
        updateObj: (data: any) => {
            return request.post({url: '/yxt/building/update', data})
        },
        // 下拉选项
        getSimpleList: () => {
            return request.get({url: '/yxt/building/get-simple-list'})
        },
    }
}
